package com.example.webexceldemo.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import java.util.Date;

@Data
@HeadRowHeight(35) // 列表头高
@ContentRowHeight(16) // 行高
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) //表头样式居中
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) //内容样式居中
public class Context {
    @ColumnWidth(70) // 列宽
    @ExcelProperty(value = "标题")
    private String title;
    @ColumnWidth(15) // 列宽
    @ExcelProperty(value = "发表时间")
    private String date;
    @ColumnWidth(15) // 列宽
    @ExcelProperty(value = "阅读数")
    private Integer views;
    @ColumnWidth(15) // 列宽
    @ExcelProperty(value = "页码")
    private Integer page;
    @ColumnWidth(100) // 列宽
    @ExcelProperty(value = "封面")
    private String path;
}
